/*
* ============================================================================
* 功能描述 ：GPIO模拟I2C功能
* 作者       ：ggls
* 创建日期 ：2024.04.24
* ----------------------------------------------------------------------------
* 更新历史 ：
*	日期 　　- 修改者   : 更新内容描述
*
* ============================================================================
*/

#ifndef __HLY_I2C_H__
#define __HLY_I2C_H__


#include "main.h"

#define  SCL_H  RA2 = 1
#define  SCL_L  RA2 = 0

#define  SDA_H  RA1 = 1
#define  SDA_L  RA1 = 0


void I2C_Start(void);
void I2C_Gpio_Init(void);
void I2C_Stop(void);
void read_ACK(void);
void I2C_init();
void write_byte(unsigned char date);
unsigned char read_byte() ;
void write_add(unsigned char address,unsigned char date) ;
unsigned char read_add(unsigned char address,char ACK);
void send_ACK(char ACK);
void write_MultipleByte(unsigned char address,unsigned char length,unsigned char *date);
void read_MultipleByte(unsigned char *temp,unsigned char address,unsigned char data_size) ;


#endif

